package ${package};

import io.mybatis.provider.Entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.JdbcType;

<#list it.importJavaTypes as javaType>
import ${javaType};
</#list>

/**
 * ${it.name} - ${it.comment}
 *
 * @author ${SYS['user.name']}
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@Entity.Table(value = "${it.name}", <#if it.comment?has_content>remark = "${it.comment}", </#if>autoResultMap = true)
public class ${it.name.className} extends BaseBean {

    <#list it.columns as column>
    <#if column.name!="id"
        &&column.name!="pid"
        &&column.name!="bid"
        &&column.name!="sfid"
        &&column.name!="uuid"
        &&column.name!="sort"
        &&column.name!="state"
        &&column.name!="remark"
        &&column.name!="created_by"
        &&column.name!="created_time"
        &&column.name!="updated_by"
        &&column.name!="updated_time">
    <#if column.pk>
    @Entity.Column(value = "${column.name}", id = true, remark = "${column.comment}", updatable = false, insertable = false)
    <#else>
    @Entity.Column(value = "${column.name}", remark = "${column.comment}"<#if column.tags.jdbcType>, jdbcType = JdbcType.${column.jdbcType}</#if>)
    </#if>
    private ${column.javaType} ${column.name.fieldName};
    </#if>
    </#list>

}
